#include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
    int removeDuplicates(vector<int>& nums) {
        int retlen = nums.size();
        vector<int>::iterator it = nums.begin();
        for (int slow = 0, fast = slow + 1; fast < nums.size();) {
            if (nums[fast] == nums[slow]) {
                nums.erase(it + fast);
                retlen--;
            }
            else {
                slow++;
                fast++;
            }
        }
        return retlen;
    }
};
int main() {
    return 0;
}